<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>角色管理</title>
</head>
<body>
<form method="post" action="">
    <input type="hidden" name="_method" value="DELETE">
</form>
<c:if test="${empty requestScope.roles}">
    <h1>没有数据</h1>
</c:if>
<c:if test="${!empty requestScope.roles}">
    <table>
        <tr>
            <td>角色ID</td>
            <td>角色名称</td>
            <td>删除</td>
            <td>编辑</td>
        </tr>

        <c:forEach var="role" items="${requestScope.roles}">
            <tr>
                <td>${role.id}</td>
                <td>${role.name}</td>
                <td><a class="delete" href="/role/${role.id}">删除</a></td>
                <td><a href="/role/${role.id}">编辑</a></td>
            </tr>
        </c:forEach>
    </table>
</c:if>
<a href="/role">添加角色</a>
<script src="/js/jquery-3.1.0.min.js"></script>
<script src="/js/common.js"></script>
</body>
</html>
